﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/User.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web.Configuration" %>

<script runat="server">
    int fundGoalMAX = 0;
    int highGoalMAX = 0;
    int currGoalMAX = 0;
    string sqlConnectionStr = WebConfigurationManager.ConnectionStrings["CDIO1ConnectionString"].ConnectionString;

    protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)
    {
        lbCourseID.Text = (DetailsView1.FindControl("lbID") as Label).Text;
    }

    protected void lbInsertRef_Click(object sender, EventArgs e)
    {
        SqlDataSourceReference.InsertParameters[0].DefaultValue = lbCourseID.Text;
        SqlDataSourceReference.InsertParameters[1].DefaultValue = (gvReference.FooterRow.FindControl("txtReference") as TextBox).Text;
        SqlDataSourceReference.Insert();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        lbCourseID.Text = (DetailsView1.FindControl("lbID") as Label).Text;

        string query = "";
        SqlConnection cnn = new SqlConnection(sqlConnectionStr);
        SqlCommand cmd = new SqlCommand("select count(*) from FundaGenericGoal", cnn);
        cnn.Open();
        fundGoalMAX = (int)cmd.ExecuteScalar();
        cmd = new SqlCommand("select count(*) from HighGeneGoal", cnn);
        highGoalMAX = (int)cmd.ExecuteScalar();
        query = "select count(*) from CourseLO where CourseID = " + lbCourseID.Text;
        cmd = new SqlCommand(query, cnn);
        currGoalMAX = (int)cmd.ExecuteScalar();
        cnn.Close();
        currGoalMAX += fundGoalMAX + highGoalMAX;

        if (!IsPostBack)
        {
            // set checkboxs in fundamental generic goal
            DataView dv1 = (DataView)SqlDataSourceCourseGenGoal.Select(DataSourceSelectArguments.Empty);
            for (int i = 0; i < dv1.Table.Rows.Count; i++)
            {
                (gvFundGenGoal.Rows[(int)dv1.Table.Rows[i][2] - 1].FindControl("cbFundGenGoal") as CheckBox).Checked = true;
            }

            // set checkboxs in high generic goal
            DataView dv2 = (DataView)SqlDataSourceCourseHighGenGoal.Select(DataSourceSelectArguments.Empty);
            for (int i = 0; i < dv2.Table.Rows.Count; i++)
            {
                (gvHighGenGoal.Rows[(int)dv2.Table.Rows[i][2] - 1].FindControl("cbHighGenGoal") as CheckBox).Checked = true;
            }
        }
    }

    protected void btnUpdateCourseFundGenGoal_Click(object sender, EventArgs e)
    {
        // simplest way of update, delete all and insert
        SqlDataSourceCourseGenGoal.DeleteParameters[0].DefaultValue = lbCourseID.Text;  // courseID
        SqlDataSourceCourseGenGoal.Delete();

        SqlDataSourceCourseGenGoal.InsertParameters[0].DefaultValue = lbCourseID.Text; // courseID        
        SqlDataSourceCourseGenGoal.InsertParameters[3].DefaultValue = "1";
        for (int i = 0; i < gvFundGenGoal.Rows.Count; i++)
        {
            if ((gvFundGenGoal.Rows[i].FindControl("cbFundGenGoal") as CheckBox).Checked)
            {
                SqlDataSourceCourseGenGoal.InsertParameters[1].DefaultValue =
                    (gvFundGenGoal.Rows[i].FindControl("lbFundGenGoalID") as Label).Text;
                SqlDataSourceCourseGenGoal.InsertParameters[2].DefaultValue =
                    (gvFundGenGoal.Rows[i].FindControl("txtFundGenGoalDesciption") as TextBox).Text;
                SqlDataSourceCourseGenGoal.Insert();
            }
        }
    }

    protected void btnUpdateCourseHighGenGoal_Click(object sender, EventArgs e)
    {
        // simplest way of update, delete all and insert        
        SqlDataSourceCourseHighGenGoal.DeleteParameters[0].DefaultValue = lbCourseID.Text;  // courseID
        SqlDataSourceCourseHighGenGoal.Delete();

        SqlDataSourceCourseHighGenGoal.InsertParameters[0].DefaultValue = lbCourseID.Text; // courseID        
        SqlDataSourceCourseHighGenGoal.InsertParameters[3].DefaultValue = "1";
        for (int i = 0; i < gvHighGenGoal.Rows.Count; i++)
        {
            if ((gvHighGenGoal.Rows[i].FindControl("cbHighGenGoal") as CheckBox).Checked)
            {
                SqlDataSourceCourseHighGenGoal.InsertParameters[1].DefaultValue =
                    (gvHighGenGoal.Rows[i].FindControl("lbHighGenGoalID") as Label).Text;
                SqlDataSourceCourseHighGenGoal.InsertParameters[2].DefaultValue =
                    (gvHighGenGoal.Rows[i].FindControl("txtHighGenGoalDescription") as TextBox).Text;
                SqlDataSourceCourseHighGenGoal.Insert();
            }
        }
    }

    protected void gvFundGenGoal_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string str = (e.Row.FindControl("lbRelatedLO") as Label).Text;
            string[] strs = str.Split(",".ToCharArray());
            for (int i = 0; i < strs.Length; i++)
            {
                (e.Row.FindControl("txtRelatedLO") as TextBox).Text += strs[i] + "\n";
            }
            if (strs.Length == 1)
            {
                (e.Row.FindControl("txtRelatedLO") as TextBox).TextMode = TextBoxMode.SingleLine;
            }
        }
    }

    protected void gvHighGenGoal_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            (e.Row.FindControl("lbHighGoalIDFake") as Label).Text
                = "L" + (Int32.Parse((e.Row.FindControl("lbHighGenGoalID") as Label).Text) + fundGoalMAX);

            string str = (e.Row.FindControl("lbRelatedLO") as Label).Text;
            string[] strs = str.Split(",".ToCharArray());
            for (int i = 0; i < strs.Length; i++)
            {
                (e.Row.FindControl("txtRelatedLO") as TextBox).Text += strs[i] + "\n";
            }
            if (strs.Length == 1)
            {
                (e.Row.FindControl("txtRelatedLO") as TextBox).TextMode = TextBoxMode.SingleLine;
            }
        }
    }

    protected void btnAddLO_Click(object sender, EventArgs e)
    {
        if (ddlFieldLO.SelectedValue == "1")
        {
            SqlDataSourceCourseLO1.InsertParameters[0].DefaultValue = "L" + ++currGoalMAX;
            SqlDataSourceCourseLO1.InsertParameters[1].DefaultValue = lbCourseID.Text;
            SqlDataSourceCourseLO1.InsertParameters[2].DefaultValue = txtCourseOutcomes.Text;
            SqlDataSourceCourseLO1.InsertParameters[3].DefaultValue = ddlProgOutComes.SelectedValue;
            SqlDataSourceCourseLO1.Insert();
        }
        else if (ddlFieldLO.SelectedValue == "2")
        {
            SqlDataSourceCourseLO2.InsertParameters[0].DefaultValue = "L" + ++currGoalMAX;
            SqlDataSourceCourseLO2.InsertParameters[1].DefaultValue = lbCourseID.Text;
            SqlDataSourceCourseLO2.InsertParameters[2].DefaultValue = txtCourseOutcomes.Text;
            SqlDataSourceCourseLO2.InsertParameters[3].DefaultValue = ddlProgOutComes.SelectedValue;
            SqlDataSourceCourseLO2.Insert();
        }
        else
        {
            SqlDataSourceCourseLO3.InsertParameters[0].DefaultValue = "L" + ++currGoalMAX;
            SqlDataSourceCourseLO3.InsertParameters[1].DefaultValue = lbCourseID.Text;
            SqlDataSourceCourseLO3.InsertParameters[2].DefaultValue = txtCourseOutcomes.Text;
            SqlDataSourceCourseLO3.InsertParameters[3].DefaultValue = ddlProgOutComes.SelectedValue;
            SqlDataSourceCourseLO3.Insert();
        }
    }

    protected void gvCourseLO1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string code = (gvCourseLO1.Rows[e.RowIndex].FindControl("lbCode") as Label).Text.Trim();
        SqlConnection cnn = new SqlConnection(sqlConnectionStr);
        cnn.Open();
        SqlCommand cmd = new SqlCommand("DELETE FROM CourseContent WHERE (CourseLOID LIKE '%' + @Code + '%')", cnn);
        cmd.Parameters.AddWithValue("@Code", "%" + code + "%");

        cmd.ExecuteNonQuery();
        cnn.Close();
    }

    protected void gvCourseLO2_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string code = (gvCourseLO2.Rows[e.RowIndex].FindControl("lbCode") as Label).Text.Trim();
        SqlConnection cnn = new SqlConnection(sqlConnectionStr);
        cnn.Open();
        SqlCommand cmd = new SqlCommand("DELETE FROM CourseContent WHERE (CourseLOID LIKE '%' + @Code + '%')", cnn);
        cmd.Parameters.AddWithValue("@Code", "%" + code + "%");

        cmd.ExecuteNonQuery();
        cnn.Close();
    }

    protected void gvCourseLO3_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string code = (gvCourseLO3.Rows[e.RowIndex].FindControl("lbCode") as Label).Text.Trim();
        SqlConnection cnn = new SqlConnection(sqlConnectionStr);
        cnn.Open();
        SqlCommand cmd = new SqlCommand("DELETE FROM CourseContent WHERE (CourseLOID LIKE '%' + @Code + '%')", cnn);
        cmd.Parameters.AddWithValue("@Code", "%" + code + "%");

        cmd.ExecuteNonQuery();
        cnn.Close();
    }

    protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        if (e.CommandName == "syllabus")
        {
            Response.Redirect("/Prof/ManageSyllabus/" + lbCourseID.Text);
        }
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    ManageCourse
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <h2>
                Manage Course
                <asp:Label ID="lbCourseID" runat="server" Text="Label" Visible="False"></asp:Label>
            </h2>
            <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" Height="800px"
                Width="1024px" AutoPostBack="True" 
                OnActiveTabChanged="TabContainer1_ActiveTabChanged">
                <asp:TabPanel ID="TabPanelInfo" runat="server" HeaderText="Basic Information" BorderStyle="NotSet">
                    <ContentTemplate>
                        <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="736px" AllowPaging="True"
                            AutoGenerateRows="False" CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource1"
                            ForeColor="#333333" GridLines="None" OnItemCommand="DetailsView1_ItemCommand">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
                            <EditRowStyle BackColor="#999999" />
                            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" Width="120px" />
                            <Fields>
                                <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID">
                                    <EditItemTemplate>
                                        <asp:Label ID="lbID" runat="server" Text='<%# Eval("ID") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbID" runat="server" Text='<%# Bind("ID") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="CourseCode" HeaderText="CourseCode" SortExpression="CourseCode" />
                                <asp:BoundField DataField="CourseEnglishName" HeaderText="CourseEnglishName" SortExpression="CourseEnglishName" />
                                <asp:BoundField DataField="CourseVietnameseName" HeaderText="CourseVietnameseName"
                                    SortExpression="CourseVietnameseName" />
                                <asp:BoundField DataField="KnowledgeBlockID" HeaderText="KnowledgeBlockID" SortExpression="KnowledgeBlockID" />
                                <asp:TemplateField HeaderText="MajorInChargeID" SortExpression="MajorInChargeID">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("MajorInChargeID") %>'></asp:TextBox></EditItemTemplate>
                                    <InsertItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("MajorInChargeID") %>'></asp:TextBox></InsertItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbMajorID" runat="server" Text='<%# Bind("MajorInChargeID") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                                <asp:BoundField DataField="TheoryCredit" HeaderText="TheoryCredit" SortExpression="TheoryCredit" />
                                <asp:BoundField DataField="PraticeCredit" HeaderText="PraticeCredit" SortExpression="PraticeCredit" />
                                <asp:BoundField DataField="SelfStudyCredit" HeaderText="SelfStudyCredit" SortExpression="SelfStudyCredit" />
                                <asp:BoundField DataField="RegisterCondition" HeaderText="RegisterCondition" SortExpression="RegisterCondition" />
                                <asp:TemplateField HeaderText="Objective" SortExpression="Objective">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Height="89px" Text='<%# Bind("Objective") %>'
                                            TextMode="MultiLine" Width="226px"></asp:TextBox></EditItemTemplate>
                                    <InsertItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Height="89px" Text='<%# Bind("Objective") %>'
                                            TextMode="MultiLine" Width="226px"></asp:TextBox></InsertItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Objective") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
                                <asp:TemplateField ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update"></asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton></EditItemTemplate>
                                    <InsertItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Insert"
                                            Text="Insert"> </asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton></InsertItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="Edit"> </asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="New" Text="New"></asp:LinkButton>&#160;<asp:LinkButton
                                                    ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Delete"
                                                    Text="Delete"></asp:LinkButton>&#160;<asp:LinkButton ID="lbOpenSyllabus" runat="server"
                                                        CommandName="syllabus">Syllabus</asp:LinkButton></ItemTemplate>
                                </asp:TemplateField>
                            </Fields>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        </asp:DetailsView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            DeleteCommand="DELETE FROM [CourseInfo] WHERE [ID] = @ID" InsertCommand="INSERT INTO [CourseInfo] ([CourseCode], [CourseEnglishName], [CourseVietnameseName], [KnowledgeBlockID], [MajorInChargeID], [Description], [TheoryCredit], [PraticeCredit], [SelfStudyCredit], [RegisterCondition], [Objective], [Status]) VALUES (@CourseCode, @CourseEnglishName, @CourseVietnameseName, @KnowledgeBlockID, @MajorInChargeID, @Description, @TheoryCredit, @PraticeCredit, @SelfStudyCredit, @RegisterCondition, @Objective, @Status)"
                            
                            SelectCommand="SELECT ID, CourseCode, CourseEnglishName, CourseVietnameseName, KnowledgeBlockID, MajorInChargeID, Description, TheoryCredit, PraticeCredit, SelfStudyCredit, RegisterCondition, Objective, ContentIndividualSkill, ContentGroupSkill, Status FROM CourseInfo WHERE (ID = @ID)" 
                            UpdateCommand="UPDATE [CourseInfo] SET [CourseCode] = @CourseCode, [CourseEnglishName] = @CourseEnglishName, [CourseVietnameseName] = @CourseVietnameseName, [KnowledgeBlockID] = @KnowledgeBlockID, [MajorInChargeID] = @MajorInChargeID, [Description] = @Description, [TheoryCredit] = @TheoryCredit, [PraticeCredit] = @PraticeCredit, [SelfStudyCredit] = @SelfStudyCredit, [RegisterCondition] = @RegisterCondition, [Objective] = @Objective, [Status] = @Status WHERE [ID] = @ID">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="ID" QueryStringField="id" />
                            </SelectParameters>
                            <DeleteParameters>
                                <asp:Parameter Name="ID" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="CourseCode" Type="String" />
                                <asp:Parameter Name="CourseEnglishName" Type="String" />
                                <asp:Parameter Name="CourseVietnameseName" Type="String" />
                                <asp:Parameter Name="KnowledgeBlockID" Type="Int32" />
                                <asp:Parameter Name="MajorInChargeID" Type="Int32" />
                                <asp:Parameter Name="Description" Type="String" />
                                <asp:Parameter Name="TheoryCredit" Type="Int32" />
                                <asp:Parameter Name="PraticeCredit" Type="Int32" />
                                <asp:Parameter Name="SelfStudyCredit" Type="Int32" />
                                <asp:Parameter Name="RegisterCondition" Type="String" />
                                <asp:Parameter Name="Objective" Type="String" />
                                <asp:Parameter Name="Status" Type="Int32" />
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="CourseCode" Type="String" />
                                <asp:Parameter Name="CourseEnglishName" Type="String" />
                                <asp:Parameter Name="CourseVietnameseName" Type="String" />
                                <asp:Parameter Name="KnowledgeBlockID" Type="Int32" />
                                <asp:Parameter Name="MajorInChargeID" Type="Int32" />
                                <asp:Parameter Name="Description" Type="String" />
                                <asp:Parameter Name="TheoryCredit" Type="Int32" />
                                <asp:Parameter Name="PraticeCredit" Type="Int32" />
                                <asp:Parameter Name="SelfStudyCredit" Type="Int32" />
                                <asp:Parameter Name="RegisterCondition" Type="String" />
                                <asp:Parameter Name="Objective" Type="String" />
                                <asp:Parameter Name="Status" Type="Int32" />
                                <asp:Parameter Name="ID" Type="Int32" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="TabPanelLO" runat="server" HeaderText="Learning Outcomes">
                    <ContentTemplate>
                        &#160;<table style="width: 100%;">
                            <tr>
                                <td style="height: 21px; width: 115px">
                                    Course Outcomes:
                                </td>
                                <td style="height: 21px; width: 153px">
                                    <asp:TextBox ID="txtCourseOutcomes" runat="server" Width="429px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 115px">
                                    Program Outcomes:
                                </td>
                                <td style="width: 153px">
                                    <asp:DropDownList ID="ddlProgOutComes" runat="server" DataSourceID="SqlDataSourceDDLProgOutComes"
                                        DataTextField="Code" DataValueField="ID" Style="margin-left: 0px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 115px">
                                    Field:
                                </td>
                                <td style="width: 153px">
                                    <asp:DropDownList ID="ddlFieldLO" runat="server" Height="17px" Width="92px">
                                        <asp:ListItem Value="1">Kiến thức</asp:ListItem>
                                        <asp:ListItem Value="2">Kỹ năng</asp:ListItem>
                                        <asp:ListItem Value="3">Thái độ</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>
                        &#160;<asp:SqlDataSource ID="SqlDataSourceDDLProgOutComes" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            SelectCommand="SELECT ProgramOutcome.ID, ProgramOutcome.ProgramID, ProgramOutcome.Code, ProgramOutcome.Description, ProgramOutcome.Status FROM (SELECT Major.ProgramID FROM Major INNER JOIN CourseInfo ON Major.ID = CourseInfo.MajorInChargeID WHERE (CourseInfo.ID = @CourseID)) AS derivedtbl_1 INNER JOIN ProgramOutcome ON derivedtbl_1.ProgramID = ProgramOutcome.ProgramID">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lbCourseID" Name="CourseID" PropertyName="Text" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <asp:Button ID="btnAddLO" runat="server" Text="Add" OnClick="btnAddLO_Click" /><br />
                        <asp:Label ID="Label11" runat="server" Text="*NOTE: The code increase automatically when the user insert new Learning Outcomes"></asp:Label><h1>
                            Kiến thức</h1>
                        <asp:GridView ID="gvCourseLO1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                            DataSourceID="SqlDataSourceCourseLO1" CellPadding="4" ForeColor="#333333" GridLines="None"
                            Style="margin-bottom: 0px" OnRowDeleting="gvCourseLO1_RowDeleting">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID" Visible="False">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbID" runat="server" Text='<%# Bind("ID") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Code" SortExpression="Code">
                                    <EditItemTemplate>
                                        <asp:Label ID="lbCode" runat="server" Text='<%# Bind("Code") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbCode" runat="server" Text='<%# Bind("Code") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="CourseOutcomes" SortExpression="CourseOutcomes">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("CourseOutcomes") %>'></asp:TextBox></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("CourseOutcomes") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ProgramOutComesID" SortExpression="ProgramOutComesID">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlProgOutComes" runat="server" DataSourceID="SqlDataSourceDDLProgOutComes"
                                            DataTextField="Code" DataValueField="ID" SelectedValue='<%# Bind("ProgramOutComesID") %>'
                                            Style="margin-left: 0px">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("ProgCode") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="GroupOutcomes" SortExpression="GroupOutcomes" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("GroupOutcomes") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update"></asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="Edit"></asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton></ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSourceCourseLO1" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            DeleteCommand="DELETE FROM CourseLO WHERE (ID = @ID)" InsertCommand="INSERT INTO CourseLO(Code, CourseID, CourseOutcomes, ProgramOutComesID, GroupOutcomes, Status) VALUES (@Code, @CourseID, @CourseOutcomes, @ProgramOutComesID, 1, 1)"
                            SelectCommand="SELECT CourseLO.ID, CourseLO.Code, CourseLO.CourseID, CourseLO.CourseOutcomes, CourseLO.ProgramOutComesID, CourseLO.GroupOutcomes, CourseLO.Status, ProgramOutcome.Code AS ProgCode FROM CourseLO INNER JOIN ProgramOutcome ON CourseLO.ProgramOutComesID = ProgramOutcome.ID WHERE (CourseLO.CourseID = @CourseID) AND (CourseLO.GroupOutcomes = @GroupOutcomes)"
                            UpdateCommand="UPDATE [CourseLO] SET [Code] = @Code, [CourseOutcomes] = @CourseOutcomes, [ProgramOutComesID] = @ProgramOutComesID WHERE [ID] = @ID">
                            <DeleteParameters>
                                <asp:Parameter Name="ID" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="Code" Type="String" />
                                <asp:Parameter Name="CourseID" Type="Int32" />
                                <asp:Parameter Name="CourseOutcomes" Type="String" />
                                <asp:Parameter Name="ProgramOutComesID" Type="Int32" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lbCourseID" Name="CourseID" PropertyName="Text"
                                    Type="Int32" />
                                <asp:Parameter DefaultValue="1" Name="GroupOutcomes" Type="Int32" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="Code" Type="String" />
                                <asp:Parameter Name="CourseOutcomes" Type="String" />
                                <asp:Parameter Name="ProgramOutComesID" Type="Int32" />
                                <asp:Parameter Name="ID" Type="Int32" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                        <h1>
                            Thái độ</h1>
                        <asp:GridView ID="gvCourseLO2" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            DataKeyNames="ID" DataSourceID="SqlDataSourceCourseLO2" ForeColor="#333333" GridLines="None">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                                    SortExpression="ID" Visible="False" />
                                <asp:TemplateField HeaderText="Code" SortExpression="Code">
                                    <ItemTemplate>
                                        <asp:Label ID="lbCode" runat="server" Text='<%# Bind("Code") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="CourseID" HeaderText="CourseID" SortExpression="CourseID"
                                    Visible="False" />
                                <asp:TemplateField HeaderText="CourseOutcomes" SortExpression="CourseOutcomes">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CourseOutcomes") %>'></asp:TextBox></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CourseOutcomes") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ProgramOutComesID" SortExpression="ProgramOutComesID">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlProgOutComes" runat="server" DataSourceID="SqlDataSourceDDLProgOutComes"
                                            DataTextField="Code" DataValueField="ID" SelectedValue='<%# Bind("ProgramOutComesID") %>'
                                            Style="margin-left: 0px">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("ProgCode") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update"></asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="Edit"></asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton></ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSourceCourseLO2" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            DeleteCommand="DELETE FROM CourseLO WHERE (ID = @ID)" InsertCommand="INSERT INTO [CourseLO] ([Code], [CourseID], [CourseOutcomes], [ProgramOutComesID], [GroupOutcomes], [Status]) VALUES (@Code, @CourseID, @CourseOutcomes, @ProgramOutComesID, 2, 1)"
                            SelectCommand="SELECT CourseLO.ID, CourseLO.Code, CourseLO.CourseID, CourseLO.CourseOutcomes, CourseLO.ProgramOutComesID, CourseLO.GroupOutcomes, CourseLO.Status, ProgramOutcome.Code AS ProgCode FROM CourseLO INNER JOIN ProgramOutcome ON CourseLO.ProgramOutComesID = ProgramOutcome.ID WHERE (CourseLO.CourseID = @CourseID) AND (CourseLO.GroupOutcomes = @GroupOutcomes)"
                            UpdateCommand="UPDATE [CourseLO] SET [Code] = @Code, [CourseOutcomes] = @CourseOutcomes, [ProgramOutComesID] = @ProgramOutComesID WHERE [ID] = @ID">
                            <DeleteParameters>
                                <asp:Parameter Name="ID" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="Code" Type="String" />
                                <asp:Parameter Name="CourseID" Type="Int32" />
                                <asp:Parameter Name="CourseOutcomes" Type="String" />
                                <asp:Parameter Name="ProgramOutComesID" Type="Int32" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lbCourseID" Name="CourseID" PropertyName="Text"
                                    Type="Int32" />
                                <asp:Parameter DefaultValue="2" Name="GroupOutcomes" Type="Int32" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="Code" Type="String" />
                                <asp:Parameter Name="CourseOutcomes" Type="String" />
                                <asp:Parameter Name="ProgramOutComesID" Type="Int32" />
                                <asp:Parameter Name="ID" Type="Int32" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                        <h1>
                            Kỹ năng</h1>
                        <asp:GridView ID="gvCourseLO3" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            DataKeyNames="ID" DataSourceID="SqlDataSourceCourseLO3" ForeColor="#333333" GridLines="None"
                            OnRowDeleting="gvCourseLO3_RowDeleting">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID" Visible="False">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbID" runat="server" Text='<%# Bind("ID") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Code" SortExpression="Code">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Code") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Code") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="CourseOutcomes" SortExpression="CourseOutcomes">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("CourseOutcomes") %>'></asp:TextBox></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("CourseOutcomes") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="GroupOutcomes" SortExpression="GroupOutcomes" Visible="False">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("GroupOutcomes") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("GroupOutcomes") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ProgramOutComesID" SortExpression="ProgramOutComesID">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlProgOutComes" runat="server" DataSourceID="SqlDataSourceDDLProgOutComes"
                                            DataTextField="Code" DataValueField="ID" SelectedValue='<%# Bind("ProgramOutComesID") %>'
                                            Style="margin-left: 0px">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("ProgCode") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update"></asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="Edit"></asp:LinkButton>&#160;<asp:LinkButton ID="LinkButton2" runat="server"
                                                CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton></ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSourceCourseLO3" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            DeleteCommand="DELETE FROM [CourseLO] WHERE [ID] = @ID" InsertCommand="INSERT INTO [CourseLO] ([Code], [CourseID], [CourseOutcomes], [ProgramOutComesID], [GroupOutcomes], [Status]) VALUES (@Code, @CourseID, @CourseOutcomes, @ProgramOutComesID, 3, 1)"
                            SelectCommand="SELECT CourseLO.ID, CourseLO.Code, CourseLO.CourseID, CourseLO.CourseOutcomes, CourseLO.ProgramOutComesID, CourseLO.GroupOutcomes, CourseLO.Status, ProgramOutcome.Code AS ProgCode FROM CourseLO INNER JOIN ProgramOutcome ON CourseLO.ProgramOutComesID = ProgramOutcome.ID WHERE (CourseLO.CourseID = @CourseID) AND (CourseLO.GroupOutcomes = @GroupOutcomes)"
                            UpdateCommand="UPDATE [CourseLO] SET [Code] = @Code, [CourseOutcomes] = @CourseOutcomes, [ProgramOutComesID] = @ProgramOutComesID WHERE [ID] = @ID">
                            <DeleteParameters>
                                <asp:Parameter Name="ID" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="Code" Type="String" />
                                <asp:Parameter Name="CourseID" Type="Int32" />
                                <asp:Parameter Name="CourseOutcomes" Type="String" />
                                <asp:Parameter Name="ProgramOutComesID" Type="Int32" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lbCourseID" Name="CourseID" PropertyName="Text"
                                    Type="Int32" />
                                <asp:Parameter DefaultValue="3" Name="GroupOutcomes" Type="Int32" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="Code" Type="String" />
                                <asp:Parameter Name="CourseOutcomes" Type="String" />
                                <asp:Parameter Name="ProgramOutComesID" Type="Int32" />
                                <asp:Parameter Name="ID" Type="Int32" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="TabPanelFundaGenericGoal" runat="server" HeaderText="Fundamental Generic Goals">
                    <HeaderTemplate>
                        Fundamental Generic Goals</HeaderTemplate>
                    <ContentTemplate>
                        <asp:GridView ID="gvFundGenGoal" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                            DataSourceID="SqlDataSourceGenGoal" CellPadding="4" ForeColor="#333333" GridLines="None"
                            OnRowDataBound="gvFundGenGoal_RowDataBound">
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <Columns>
                                <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label8" runat="server" Text='<%# Eval("ID") %>' Visible="False"></asp:Label><asp:Label
                                            ID="Label9" runat="server" Text='<%# Eval("ID","L{0}") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbFundGenGoalID" runat="server" Text='<%# Bind("ID") %>' Visible="False"></asp:Label><asp:Label
                                            ID="Label9" runat="server" Text='<%# Eval("ID","L{0}") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Requirement" HeaderText="Requirement" SortExpression="Requirement" />
                                <asp:TemplateField HeaderText="RelatedLO" SortExpression="RelatedLO">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RelatedLO") %>'></asp:TextBox></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbRelatedLO" runat="server" Text='<%# Bind("RelatedLO") %>' Visible="False"></asp:Label><asp:TextBox
                                            ID="txtRelatedLO" runat="server" TextMode="MultiLine"></asp:TextBox></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbFundGenGoal" runat="server" /></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Description">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtFundGenGoalDesciption" runat="server"></asp:TextBox></ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#999999" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSourceGenGoal" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            SelectCommand="SELECT * FROM [FundaGenericGoal]"></asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSourceCourseGenGoal" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            DeleteCommand="DELETE FROM [CourseFundaGeneGoal] WHERE [CourseID] = @CourseID"
                            InsertCommand="INSERT INTO [CourseFundaGeneGoal] ([CourseID], [FundaGeneGoalID], [Description], [Status]) VALUES (@CourseID, @FundaGeneGoalID, @Description, @Status)"
                            SelectCommand="SELECT * FROM [CourseFundaGeneGoal] WHERE [CourseID] = @CourseID">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lbCourseID" Name="CourseID" PropertyName="Text" />
                            </SelectParameters>
                            <DeleteParameters>
                                <asp:Parameter Name="CourseID" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="CourseID" Type="Int32" />
                                <asp:Parameter Name="FundaGeneGoalID" Type="Int32" />
                                <asp:Parameter Name="Description" Type="String" />
                                <asp:Parameter Name="Status" Type="Int32" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                        <center>
                            <asp:Button ID="btnUpdateCourseFundGenGoal" runat="server" OnClick="btnUpdateCourseFundGenGoal_Click"
                                Text="Update" Height="26px" /></center>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="TabPanelHighGenericGoal" runat="server" HeaderText="High Generic Goals">
                    <HeaderTemplate>
                        High Generic Goals</HeaderTemplate>
                    <ContentTemplate>
                        <asp:GridView ID="gvHighGenGoal" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                            DataSourceID="SqlDataSourceHighGenGoal" CellPadding="4" ForeColor="#333333" GridLines="None"
                            OnRowDataBound="gvHighGenGoal_RowDataBound">
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <Columns>
                                <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>' Visible="False"></asp:Label><asp:Label
                                            ID="Label10" runat="server" Text='<%# Bind("ID","L{0}") %>'></asp:Label></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbHighGenGoalID" runat="server" Text='<%# Bind("ID") %>' Visible="False"></asp:Label><asp:Label
                                            ID="lbHighGoalIDFake" runat="server"></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Requirement" HeaderText="Requirement" SortExpression="Requirement" />
                                <asp:TemplateField HeaderText="RelatedLO" SortExpression="RelatedLO">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RelatedLO") %>'></asp:TextBox></EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lbRelatedLO" runat="server" Text='<%# Bind("RelatedLO") %>' Visible="False"></asp:Label><asp:TextBox
                                            ID="txtRelatedLO" runat="server" TextMode="MultiLine"></asp:TextBox></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbHighGenGoal" runat="server" /></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Description">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtHighGenGoalDescription" runat="server"></asp:TextBox></ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#999999" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSourceHighGenGoal" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            SelectCommand="SELECT * FROM [HighGeneGoal]"></asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSourceCourseHighGenGoal" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            DeleteCommand="DELETE FROM [CourseHighGeneGoal] WHERE [CourseID] = @CourseID"
                            InsertCommand="INSERT INTO [CourseHighGeneGoal] ([CourseID], [HighGeneGoalID], [Description], [Status]) VALUES (@CourseID, @HighGeneGoalID, @Description, @Status)"
                            SelectCommand="SELECT * FROM [CourseHighGeneGoal] WHERE ([CourseID] = @CourseID)">
                            <DeleteParameters>
                                <asp:Parameter Name="CourseID" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="CourseID" Type="Int32" />
                                <asp:Parameter Name="HighGeneGoalID" />
                                <asp:Parameter Name="Description" Type="String" />
                                <asp:Parameter Name="Status" Type="Int32" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lbCourseID" Name="CourseID" PropertyName="Text"
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <center>
                            <asp:Button ID="btnUpdateCourseHighGenGoal" runat="server" Height="26px" OnClick="btnUpdateCourseHighGenGoal_Click"
                                Text="Update" /></center>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="TabPanelReference" runat="server" HeaderText="Reference">
                    <ContentTemplate>
                        <asp:GridView ID="gvReference" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            DataKeyNames="ID" DataSourceID="SqlDataSourceReference" ForeColor="#333333" GridLines="None"
                            AllowPaging="True" ShowFooter="True" Style="margin-top: 0px">
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <Columns>
                                <asp:TemplateField HeaderText="CourseID" SortExpression="CourseID" Visible="False">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CourseID") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CourseID") %>'>
                                        </asp:Label>
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CourseID") %>'>
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Reference" SortExpression="Reference">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtReference" runat="server" Text='<%# Bind("Reference") %>'>
                                        </asp:TextBox>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:TextBox ID="txtReference" runat="server" Text='<%# Bind("Reference") %>'>
                                        </asp:TextBox>
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Reference") %>'>
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update">
                                        </asp:LinkButton>
                                        &#160;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                            Text="Cancel"></asp:LinkButton>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:LinkButton ID="lbInsertRef" runat="server" ForeColor="White" OnClick="lbInsertRef_Click">
                                Insert</asp:LinkButton>
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="Edit">
                                        </asp:LinkButton>
                                        &#160;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                            Text="Delete"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#999999" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSourceReference" runat="server" ConnectionString="<%$ ConnectionStrings:CDIO1ConnectionString %>"
                            SelectCommand="SELECT * FROM [CourseReference] WHERE ([CourseID] = @CourseID)"
                            UpdateCommand="UPDATE [CourseReference] SET [Reference] = @Reference WHERE [ID] = @ID"
                            DeleteCommand="DELETE FROM [CourseReference] WHERE [ID] = @ID" InsertCommand="INSERT INTO [CourseReference] ([CourseID], [Reference], [Status]) VALUES (@CourseID, @Reference, 1)">
                            <DeleteParameters>
                                <asp:Parameter Name="ID" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="CourseID" Type="Int32" />
                                <asp:Parameter Name="Reference" Type="String" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lbCourseID" Name="CourseID" 
                                    PropertyName="Text" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="Reference" Type="String" />
                                <asp:Parameter Name="ID" Type="Int32" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" runat="server"
        TargetControlID="UpdatePanel2" Enabled="True">
        <Animations>
            <OnUpdating>                
                <FadeOut minimumOpacity=".5" />
            </OnUpdating>
            <OnUpdated>
                <FadeIn minimumOpacity=".5" />
            </OnUpdated></Animations>
    </asp:UpdatePanelAnimationExtender>
</asp:Content>
